package com.ahoi;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.servlet.DispatcherServlet;

@EnableAutoConfiguration
@SpringBootApplication
@EnableCaching
@MapperScan("com.ahoi.dao")
public class DemoApplication {

    public static void main(String[] args) {
//        System.setProperty("https.proxySet", "true");
//        System.getProperties().put("https.proxyHost", "192.168.1.16");
//        System.getProperties().put("https.proxyPort", "808");

        SpringApplication.run(DemoApplication.class, args);
    }

    @Bean
    public ServletRegistrationBean dispatcherRegistration(DispatcherServlet dispatcherServlet) {
        ServletRegistrationBean registration = new ServletRegistrationBean(dispatcherServlet);
        registration.addUrlMappings("*.do", "*.go");
        return registration;
    }
}
